using System.Collections.Generic;
using System;

namespace Commons.Utils.Extractors
{
	[Serializable]
	public class ValuePath
	{
		public List<string> AttributePath { get; set; }
		public List<string> CapabilityAttributePath { get; set; }
		public string Capability { get; set; }

		public bool IsFromAttribute()
		{
			return AttributePath != null && AttributePath.Count > 0;
		}

		public bool IsFromCapability()
		{
			return Capability != null;
		}

		public override string ToString()
		{
			return string.Format("[ValuePath: AttributePath={0}, CapabilityAttributePath={1}, Capability={2}]", ToStringHelper(AttributePath), ToStringHelper(CapabilityAttributePath), Capability);
		}

		private string ToStringHelper(List<string> list)
		{
			return list == null ? "NULL" : string.Join(".", list.ToArray());
		}
	}
}

